package work.distil;

import java.util.ArrayList;
import java.util.List;

public class XDistilBot {

	public static final String[] ThreatTypes = new String[]{
		"Known Violators",
		"Blocked Country",
		"Browser Integrity Check",
		"Known Violator User Agent",
		"Rate Limited",
		"Known Violator Honeypot Access",
		"Referrer Block",
		"Session Length Exceeded",
		"Pages Per Session Exceeded",
		"Bad User Agents",
		"Aggregator User Agents",
		"Filtered IP",
		"JavaScript Not Loaded",
		"JavaScript Check Failed",
		"Identifier Validation Error",
		"Known Violator Automation Tool",
		"Form Spam Submission"
	};

	public static void main(String[] args) {
		int n = 100;
		System.out.println(decode(n));
	}

	private static List<String> decode(int n) {
		List<String> threats = new ArrayList<String>();

		for (int i = 0; i < ThreatTypes.length; i++) {
			if ((n & 1) == 1) {
				threats.add(ThreatTypes[i]);
			}
			n = (n >> 1);
		}

		return threats;
	}
}
